perm filename LOWERC.SAI[LIB,AIL] blob sn#408159 filedate 1979-01-09 generic text, type T, neo UTF8
entry lowercase;
begin "lowercase"
   
define library!entry = true;
require "sys:std.hdr" source!file;

internal simple string procedure lowercase(string x);
begin "lowercase"
   string y;
  
! lowercase returns a copy of argument string with all
  uppercase alphabetics changed to lowercase;

  integer temp;

  y ← null;
  while length(x) > 0 do
  begin "alpha loop"
     temp ← lop(x);
     if (temp geq "A") and (temp leq "Z") then
        temp ← temp +'40;
     y ← y & temp;
  end "alpha loop";

  return(y);
end "lowercase";
end "lowercase"